//
//  DatePickerViewController.swift
//  UI
//
//  Created by admin on 14/9/22.
//  Copyright (c) 2014年 sinosun. All rights reserved.
//
/*
enum UIDatePickerMode : Int {
case Time // Displays hour, minute, and optionally AM/PM designation depending on the locale setting (e.g. 6 | 53 | PM)
case Date // Displays month, day, and year depending on the locale setting (e.g. November | 15 | 2007)
case DateAndTime // Displays date, hour, minute, and optionally AM/PM designation depending on the locale setting (e.g. Wed Nov 15 | 6 | 53 | PM)
case CountDownTimer // Displays hour and minute (e.g. 1 | 53)
}

@availability(iOS, introduced=2.0)
class UIDatePicker : UIControl, NSCoding {
var datePickerMode: UIDatePickerMode // default is UIDatePickerModeDateAndTime

var locale: NSLocale? // default is [NSLocale currentLocale]. setting nil returns to default
@NSCopying var calendar: NSCalendar! // default is [NSCalendar currentCalendar]. setting nil returns to default
var timeZone: NSTimeZone? // default is nil. use current time zone or time zone from calendar

var date: NSDate // default is current date when picker created. Ignored in countdown timer mode. for that mode, picker starts at 0:00
var minimumDate: NSDate? // specify min/max date range. default is nil. When min > max, the values are ignored. Ignored in countdown timer mode
var maximumDate: NSDate? // default is nil

var countDownDuration: NSTimeInterval // for UIDatePickerModeCountDownTimer, ignored otherwise. default is 0.0. limit is 23:59 (86,399 seconds). value being set is div 60 (drops remaining seconds).
var minuteInterval: Int // display minutes wheel with interval. interval must be evenly divided into 60. default is 1. min is 1, max is 30

func setDate(date: NSDate, animated: Bool) // if animated is YES, animate the wheels of time to display the new date
}
*/
import UIKit

class DatePickerViewController: UIViewController {

    @IBOutlet var datePicker: UIDatePicker!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        //self.datePicker.datePickerMode = UIDatePickerMode.CountDownTimer
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @IBAction func valueChange(sender: AnyObject) {
        var datePicker = sender as UIDatePicker
        println("datePicker=\(datePicker.date)")
    }
    /*

    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
